//
//  ByModelShopCar.m
//  oc_knowledge
//
//  Created by pro on 17/1/13.
//  Copyright © 2017年 com.itboye. All rights reserved.
//

#import "ByModelShopCar.h"

@implementation ByModelShopCarListItem

- (void)setAttributes:(NSDictionary *)jsonDic {
    
    [super setAttributes:jsonDic];
    
    self.price      = @([jsonDic[@"price"] floatValue] / 100);
    self.ori_price  = @([jsonDic[@"ori_price"] floatValue] / 100);
    self.main_img   = BOYE_PICTURE_VIEW_URL(jsonDic[@"icon_url"]);
    
    // 刚加载完数据是不选中的
    self.selected = NO;
}

@end

@implementation ByModelShopCar

- (void)setAttributes:(NSDictionary *)jsonDic {
    
    [super setAttributes:jsonDic];
    
    self.store_logo = BOYE_PICTURE_VIEW_URL(jsonDic[@"store_logo"]);
    
    // 刚加载完数据是不选中的
    self.selected = NO;
    
    // 设置item数组
    NSMutableArray *temp = [[NSMutableArray alloc] init];
    NSArray *goods = jsonDic[@"goods"];
    for (NSDictionary *dic in goods) {
        ByModelShopCarListItem *itemModel = [[ByModelShopCarListItem alloc] initContentWithDic:dic];
        [temp addObject:itemModel];
    }
    self.item_list = temp.copy;
}

@end
